<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="common/header.jsp"%>
<div class="row">
	<div class="col-md-12 col-sm-12 col-xs-12">
		<div class="x_panel">
			<div class="x_title">
				<h2>
					APP 信息管理维护 ${UserSession.username}-<i class="fa fa-user"></i><small>您可以通过搜索或者其他的筛选项对APP的信息进行修改、删除等管理操作。^_^</small>
				</h2>
				<div class="clearfix"></div>
			</div>
			<div class="x_content">
				<br />
				<form action="${pageContext.request.contextPath }/backendApp/list/1" method="post" 
					id="demo-form2" data-parsley-validate
					class="form-horizontal form-label-left">
					<input type="hidden" id="currentPage" name="currentPage" value="1">
					<ul>
					<li>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12"
							for="softwareName">软件名称 <span class="required">*</span>
						</label>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<input name="softwareName" type="text" id="softwareName"
								class="form-control col-md-7 col-xs-12" value="${checkMap.softwareName }">
						</div>
					</div>
					</li>
					<li>
					<%-- <div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12"
							for="last-name">APP状态 <span class="required">*</span>
						</label>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<select name="status" class="form-control col-md-7 col-xs-12">
								<option value="">-- 请选择 --</option>
								<c:forEach items="${statusList }" var="status">
									<option <c:if test="${checkMap.status==status.valueid }">selected='selected'</c:if> value="${status.valueid }">${status.valuename }</option>
								</c:forEach>
							</select>
						</div>
					</div> --%>
					</li>
					<li>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12"
							for="last-name">所属平台 <span class="required">*</span>
						</label>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<select name="flatform" class="form-control col-md-7 col-xs-12">
								<option value="">-- 请选择 --</option>
								<c:forEach items="${flatformList }" var="flatform">
									<option <c:if test="${checkMap.flatform==flatform.valueid }">selected='selected'</c:if> value="${flatform.valueid }">${flatform.valuename }</option>
								</c:forEach>
							</select>
						</div>
					</div>
					</li>
					<li>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12"
							for="level1">一级分类 <span class="required">*</span>
						</label>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<select onchange="level1Change(this)" name="level1" id="level1"   class="form-control col-md-7 col-xs-12">
								<option value="">-- 请选择 --</option>
								<c:forEach items="${level1List }" var="level1">
									<option <c:if test="${checkMap.level1==level1.id }">selected='selected'</c:if> value="${level1.id }">${level1.categoryname }</option>
								</c:forEach>
							</select>
						</div>
					</div>
					</li>
					<li>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12"
							for="last-name">二级分类 <span class="required">*</span>
						</label>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<select onchange="level2Change(this)" name="level2" id="level2"  class="form-control col-md-7 col-xs-12">
								
								<option value="">-- 请选择 --</option>
								<c:forEach items="${level2List }" var="level2">
									<option <c:if test="${checkMap.level2==level2.id }">selected='selected'</c:if> value="${level2.id }">${level2.categoryname }</option>
								</c:forEach>
							</select>
						</div>
					</div>
					</li>
					<li>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12"
							for="last-name">三级分类 <span class="required">*</span>
						</label>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<select name="level3" id="level3" class="form-control col-md-7 col-xs-12">
								<option value="">-- 请选择 --</option>
								<c:forEach items="${level3List }" var="level3">
									<option <c:if test="${checkMap.level3==level3.id }">selected='selected'</c:if> value="${level3.id }">${level3.categoryname }</option>
								</c:forEach>
							</select>
						</div>
					</div>
					</li>
					
					
					
					
					<div class="ln_solid"></div>
					<li>
					<div class="form-group">
						<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
							<button type="submit" class="btn btn-primary">查询</button>
						</div>
					</div>
					</li>

					</ul>
				</form>
			</div>
		</div>
		
		<div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <div class="clearfix"></div>
                  </div>
                  <span style="color: red">${delInfo}</span>
                  <div class="x_content">
                    <table id="datatable" class="table table-striped table-bordered">
                      <thead>
                        <tr>
                          <th>软件名称</th>
                          <th>APK名称</th>
                          <th>软件大小(单位:M)</th>
                          <th>所属平台</th>
                          <th>所属分类(一级分类、二级分类、三级分类)</th>
                          <th>状态</th>
                          <th>下载次数</th>
                          <th>最新版本号</th>
                          <th style="width:124px">操作</th>
                        </tr>
                      </thead>


                      <tbody>
                      <c:forEach items="${pageBean.pageList }" var="appInfo">
                        <tr>
                          <td>${appInfo.softwarename }</td>
                          <td>${appInfo.apkname }</td>
                          <td>${appInfo.softwaresize }</td>
                          <td>${appInfo.flatformName }</td>
                          <td>${appInfo.level1 }>${appInfo.level2 }>${appInfo.level3 }</td>
                          <td>${appInfo.statusName }</td>
                          <td>${appInfo.downloads }</td>
                          <td>${appInfo.versionNo }</td>
                          <td>
                            <div class="btn-group">
                            <a href="${pageContext.request.contextPath }/backendApp/appcheck/${appInfo.id}" class="btn btn-danger">审核</a>
		                      <!-- <button type="button" class="btn btn-danger">审核</button> -->
		                      <%-- <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
		                        <span class="caret"></span>
		                        <span class="sr-only">Toggle Dropdown</span>
		                      </button>
		                      <ul class="dropdown-menu" role="menu">
		                      	<c:if test="${appInfo.status==2 || appInfo.status==5  }">
			                        <li><a href="#">上架</a></li>
		                      	</c:if>
		                      	<c:if test="${appInfo.status==4  }">
		                       	 <li><a href="#">下架</a></li>
		                        </c:if>
		                        <li><a href="${pageContext.request.contextPath }/devApp/disAppInfoAddVersion/${appInfo.id}">新增版本</a></li>
		                        <li><a href="javascript:;" onclick="appInfoUpdateVersion(this)" appInfoStatus="${appInfo.status}" appInfoId="${appInfo.id }" >修改版本</a></li>
		                        <li><a href="javascript:;" onclick="appInfoUpdate(this)" appInfoStatus="${appInfo.status}" appInfoId="${appInfo.id }"  >修改</a></li>
		                        <li><a href="${pageContext.request.contextPath }/devApp/disShowAppInfo/${appInfo.id}">查看</a></li>
		                        <li><a href="javascript:;" onclick="del(this)" appInfoId="${appInfo.id}">删除</a></li>
		                      </ul> --%>
		                    </div>
                    	 </td>
                        </tr>
                      </c:forEach>  
                  
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
	</div>
	
	<div class="row">
					<div class="col-sm-5">
						<div class="dataTables_info" id="datatable-responsive_info"
							role="status" aria-live="polite">共${pageBean.totalCount }条记录
							${pageBean.currentPage }/${pageBean.totalPage }页</div>
					</div>
					<div class="col-sm-7">
						<div class="dataTables_paginate paging_simple_numbers"
							id="datatable-responsive_paginate">
							<ul class="pagination">
								<c:if test="${pageBean.currentPage > 1 }">
									<li class="paginate_button previous"><a
										href="javascript:page(1);"
										aria-controls="datatable-responsive" data-dt-idx="0"
										tabindex="0">首页</a>
									</li>
									<li class="paginate_button "><a
										href="javascript:page(${pageBean.currentPage } - 1);"
										aria-controls="datatable-responsive" data-dt-idx="1"
										tabindex="0">上一页</a>
									</li>
								</c:if>	
								<c:if test="${pageBean.currentPage < pageBean.totalPage  }">
									<li class="paginate_button "><a
										href="javascript:page(${pageBean.currentPage } + 1);"
										aria-controls="datatable-responsive" data-dt-idx="1"
										tabindex="0">下一页</a>
									</li>
									<li class="paginate_button next"><a
										href="javascript:page(${pageBean.totalPage });"
										aria-controls="datatable-responsive" data-dt-idx="7"
										tabindex="0">最后一页</a>
									</li>
								</c:if>	
							</ul>
						</div>
					</div>
				</div>
	
	
</div>





<%@include file="common/footer.jsp"%>